﻿// ------------------------------------------------------------------------------
// <copyright file="ConcatenationConverterPageView.cs" company="skumaronline.com">
//    Copyright (C) 2012 Suresh Kumar T.  All rights reserved.
// </copyright>
// ------------------------------------------------------------------------------

namespace StoreAppLibDemo.ViewModel
{
    using StoreAppLib;
    using StoreAppLibDemo.Model;
    using System.Collections.Generic;
    using System.Collections.ObjectModel;

    public class ConcatenationConverterPageView : BindableBase
    {
        /// <summary>
        /// Variable to hold the company.
        /// </summary>
        private Company company;

        /// <summary>
        /// Initializes a new instance of the <see cref="ConcatenationConverterPageView"/> class"
        /// </summary>
        public ConcatenationConverterPageView()
        {
            Company company = new Company() { Name = "skumaronline.com", Departments = new ObservableCollection<Department>() };

            company.Departments.Add(new Department() { Name = "Information Technology", Employees = new ObservableCollection<Employee>() });
            company.Departments.Add(new Department() { Name = "Human Resource", Employees = new ObservableCollection<Employee>() });
            company.Departments.Add(new Department() { Name = "Sales", Employees = new ObservableCollection<Employee>() });

            company.Departments[0].Employees.Add(new Employee() { Name = "Laura", Languages = new ObservableCollection<Language>(new List<Language>() { new Language() { Name = "English" } }) });
            company.Departments[0].Employees.Add(new Employee() { Name = "Suresh", Languages = new ObservableCollection<Language>(new List<Language>() { new Language() { Name = "English" }, new Language() { Name = "Hindi" }, new Language() { Name = "Malayalam" } }) });

            company.Departments[1].Employees.Add(new Employee() { Name = "Annabel", Languages = new ObservableCollection<Language>(new List<Language>() { new Language() { Name = "English" } }) });
            company.Departments[1].Employees.Add(new Employee() { Name = "Fabio", Languages = new ObservableCollection<Language>(new List<Language>() { new Language() { Name = "English" }, new Language() { Name = "Italian" } }) });

            company.Departments[2].Employees.Add(new Employee() { Name = "Kristina", Languages = new ObservableCollection<Language>(new List<Language>() { new Language() { Name = "English" }, new Language() { Name = "Swedish" } }) });
            company.Departments[2].Employees.Add(new Employee() { Name = "Monique", Languages = new ObservableCollection<Language>(new List<Language>() { new Language() { Name = "English" }, new Language() { Name = "African" } }) });
            company.Departments[2].Employees.Add(new Employee() { Name = "Amal", Languages = new ObservableCollection<Language>(new List<Language>() { new Language() { Name = "English" }, new Language() { Name = "French" } }) });

            this.Company = company;
        }

        /// <summary>
        /// Gets or sets the company.
        /// </summary>
        /// <value>
        /// The company.
        /// </value>
        public Company Company
        {
            get
            {
                return this.company;
            }

            set
            {
                this.SetProperty(ref this.company, value);
            }
        }
    }
}
